<?php
/**
 * Created by PhpStorm.
 * User: Nevena i Milena
 * Date: 2/22/14
 * Time: 5:20 PM
 */

class Predmet implements JsonSerializable{
    private $id;
    private $naziv;

    function __construct($id, $naziv)
    {
        $this->id = $id;
        $this->naziv = $naziv;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $naziv
     */
    public function setNaziv($naziv)
    {
        $this->naziv = $naziv;
    }

    /**
     * @return mixed
     */
    public function getNaziv()
    {
        return $this->naziv;
    }


    /**
     * (PHP 5 &gt;= 5.4.0)<br/>
     * Specify data which should be serialized to JSON
     * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
     * @return mixed data which can be serialized by <b>json_encode</b>,
     * which is a value of any type other than a resource.
     */
    public function jsonSerialize()
    {
        return (object) get_object_vars($this);
    }
}